package com.sram.controller.common;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2017/2/17.
 */
@Component
public class TaskController {
    private Logger logger= Logger.getLogger(this.getClass());
    @Scheduled(cron="0/10 * *  * * ? ")   //每5秒执行一次
    public void myTest() throws Exception {
        logger.info("进入测试");
//        throw new Exception("dddd");

    }
    @Scheduled(cron="0/5 * *  * * ? ")   //每5秒执行一次
    public void myTest2(){
        logger.info("进入测试2");
    }
}
